package com.codemart.lanze.modules.cms.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.codemart.lanze.modules.cms.entity.AdvertPosition;
import com.codemart.lanze.modules.cms.mapper.AdvertPositionMapper;
import com.codemart.lanze.modules.cms.service.IAdvertPositionService;
import com.codemart.lanze.modules.sys.vo.TreeNode;

/**
 * @Description: 广告位
 * @Author: lanze
 * @Date: 2019-09-13
 * @Version: V1.0
 */
@Service
public class AdvertPositionServiceImpl extends ServiceImpl<AdvertPositionMapper, AdvertPosition>
		implements IAdvertPositionService {

	@Autowired
	private AdvertPositionMapper advertPositioncategoryMapper;

	@Override
	public AdvertPosition findByName(String name) {
		QueryWrapper<AdvertPosition> ew = new QueryWrapper<>();
		ew.eq("name", name);
		return this.getOne(ew);
	}

	@Override
	public List<TreeNode> findTreeList() {
		return advertPositioncategoryMapper.findTreeList();
	}

}
